{extends file='layout/front.html'}

{block name='main'}
<script type="text/javascript" charset="utf-8">
$('.menu4').attr('class', 'menu4_cur');
</script>
<div class="main_c">
	<div class="main_top_btn_box pb15"><a href="#" class="account_manage">账户权限管理</a></div>
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
		<tr class="table_head">
			<th>编号</th>
			<th><a href="#" class="btn_up">账号</a></th>
			<th>被管理账号</th>
			<th width="100">&nbsp;</th>
		</tr>
		{foreach $acced as $key => $val}
		<tr>
			<td>{$key+1}</td>
			<td>{$val.name}</td>
			<td>{$val.acced}</td>
			<td><a href="{$val.id}" class="edit" title="编辑"></a>
			    <a href="permission/delete.html?id={$val.id}" class="delete" title="删除"></a></td>
		</tr>
		{/foreach}
	</table>
</div>

<script type="text/javascript" charset="utf-8">
    $('.account_manage').click(function(){
        loading();
        $.get(SITE_URL+'/permission/modify.html', function(html){
            loading('off');
            $('body').append(html);
            $(window).resize();
        });
        return false;
    });

    $('.edit').click(function(){
        loading();
        $.get(SITE_URL+'/permission/edit.html?id=' + $(this).attr('href'), function(html){
            loading('off');
            $('body').append(html);
            $(window).resize();
        });
        return false;
    });

  $('.delete').click(function(){
      return confirm('确定清空分配的用户？');
  });
</script>
{/block}